package com.yingsheng.bi.hks.mapping;

import com.yingsheng.bi.hks.dto.goods.GoodsAddReq;
import com.yingsheng.bi.hks.repository.dao.po.Goods;
import com.yingsheng.bi.hks.repository.dao.po.GoodsDetail;

public class GoodsMgmtMappings {

    public static Goods reqToGoods(GoodsAddReq req){
        Goods goods = new Goods();
        goods.setName(req.getName());
        goods.setCategoryId(req.getCategoryId());
        goods.setPrice1(req.getPrice1());
        goods.setPrice2(req.getPrice2());
        goods.setStock(req.getStock());
        goods.setImage(req.getImage());
        goods.setDescription(req.getDescription());
        return goods;
    }

    public static GoodsDetail reqToGoodsDetail(GoodsAddReq req){

        GoodsDetail goodsDetail = new GoodsDetail();
        goodsDetail.setImage(req.getDetailImage());
        goodsDetail.setContent(req.getContent());
        return goodsDetail;
    }
}
